package com.huang.A02_constructor;

import com.huang.A02_constructor.Movie;
import com.huang.A02_constructor.MovieOperator;

import java.util.Scanner;

/**
 * 目标
 * 面向对象练习  展示电影信息
 */
public class Demo3 {
    public static void main(String[] args) {
        Movie[] movies = new Movie[4];
        movies[0] = new Movie(1, "全职法师", 23, 10, "莫凡", "未知", "100人想看");
        movies[1] = new Movie(2, "完美世界", 23, 10, "莫凡", "未知", "100人想看");
        movies[2] = new Movie(3, "镖人", 23, 10, "莫凡", "未知", "100人想看");
        movies[3] = new Movie(4, "狐妖小红娘", 23, 10, "莫凡", "未知", "100人想看");
        //电影操作对象
        MovieOperator mo = new MovieOperator(movies);
        Scanner sc = new Scanner(System.in);
        while (true) {
            System.out.println("欢迎来到电影系统-----------------");
            System.out.println("请选择操作");
            System.out.println("1：查询所有电影信息");
            System.out.println("2：根据id查询电影信息");
            int select = sc.nextInt();
            switch (select) {
                case 1:
                    mo.printAllMovies();
                    break;
                case 2:
                    System.out.println("请输入id:");
                    int id = sc.nextInt();
                    mo.selectMovieById(id);
                    break;
                default:
                    System.out.println("没有此选项");
                    break;
            }
        }
    }
}